from django.conf import settings
import hashlib

# 数据库密码显示为密文设置

# settings.SECRET_KEY 是setting里面自带的密文
def md5(data_string):
    obj = hashlib.md5(settings.SECRET_KEY.encode('utf-8'))
    obj.update(data_string.encode('utf-8'))
    return obj.hexdigest()